<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;

class CreateAkbusAttendanceCollectTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('akbus_attendance_collect', function (Blueprint $table) {
            $table->id();
            $table->tinyInteger('line')->nullable()->comment('线路');
            $table->string('license_plate_num')->nullable()->comment('车牌号');
            $table->string('driver')->nullable()->comment('司机');
            $table->string('start_sign_time')->nullable()->comment('最早打卡时间');
            $table->string('end_sign_time')->nullable()->comment('最晚打卡时间');
            $table->date('sign_date')->nullable()->comment('打卡日期');
            $table->string('sign_number')->default('0')->comment('打卡次数');
            $table->string('work_hours')->default('0')->comment('工作时长');
            $table->string('normal_time')->default('0')->comment('正常班');
            $table->string('over_time')->default('0')->comment('加班');
            $table->string('night_over_time')->default('0')->comment('晚上加班');
            $table->string('modify_reason')->nullable()->comment('修改原因');
            $table->tinyInteger('is_del')->default(0)->comment('是否删除 0否 1是');
            $table->timestamps();
        });
        DB::statement("ALTER TABLE akbus_attendance_collect comment '考勤中间表'"); //表注释
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('akbus_attendance_collect');
    }
}
